<template>
  <div class="search-bar">
    <div style="margin: 30px">
      <el-input
        placeholder="Please input the content"
        v-model="input3"
        class="input-with-select"
        clearable
      >
        <template #prepend>
          <el-select v-model="value" placeholder="Please select" class="search-select">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </template>
        <template #append>
          <el-button icon="el-icon-search">Search</el-button>
        </template>
      </el-input>
    </div>
  </div>
</template>

<script setup>
import { reactive, ref } from '@vue/reactivity'

let input3 = ref('')
let options = reactive([
  {
    value: '选项1',
    label: 'All Species'
  },
  {
    value: '选项2',
    label: 'Plants'
  },
  {
    value: '选项3',
    label: 'Animals'
  }
])
let value = ref('')
</script>

<style lang="scss" scoped>
.search-bar {
  width: 60%;
  margin: 0 auto;
  border-radius: 10px;
  .search-select {
    width: 140px;
  }
  .el-button {
    background-color: #419640;
    color: #fff;
  }
}
</style>